package com.zijin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zijin.entity.Account2159;
import com.zijin.mapper.Account2159Mapper;
import com.zijin.service.Account2159Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 2159账户信息Service实现
 */
@Service
public class Account2159ServiceImpl extends ServiceImpl<Account2159Mapper, Account2159> implements Account2159Service {

    @Autowired
    private Account2159Mapper account2159Mapper;

    /**
     * 根据卡号查找账户信息
     *
     * @return
     */
    @Override
    public List<Account2159> findAccountByBankNo(String tradeBankNo) {
        /**
         * SELECT a.* FROM `表名` a WHERE a.trade_bank_no = '6212261605010394703'
         * */
        LambdaQueryWrapper<Account2159> queryWrapper = Wrappers.<Account2159>lambdaQuery();
        queryWrapper.eq(Account2159::getTradeBankNo, tradeBankNo);
        List<Account2159> account2159 = account2159Mapper.selectList(queryWrapper);
        return account2159;
    }
}
